<template>
	<div>
		<!-- <p>组件中v_model的使用:</p>
    <p>父组件：{{ money }}</p> -->
		<!-- 1 -->
		<!-- <input type="text" v-model="money"> -->
		<!-- 2 -->
		<!-- <input type="text" :value="money" @input="e => this.money = e.target.value"> -->
		<!-- 3 -->
		<son-1 :value="money" @input="e => (this.money = e)" />
		<!-- 4 -->
		<!-- <son-1 v-model="money" /> -->

		<p>组件中.sync的使用</p>
		<p>父组件：{{ mny }}</p>
		<!-- 1 -->
		<!-- <son-2 :text="mny" @update:text="val => (this.mny = val)" /> -->
		<son-2 :text.sync="mny" />
	</div>
</template>

<script>
	import Son1 from './components/son1.vue'
	import Son2 from './components/son2.vue'
	export default {
		components: {
			Son1,
			Son2
		},
		data() {
			return {
				money: 100,
				mny: 1
			}
		},
		methods: {
			changeF(e) {
				this.money = e
			}
		}
	}
</script>

<style lang="scss" scoped></style>
